home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / macgzip_022-src / macos / Posix / ThinkCPosix Sources / sysconf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  700 b   |  37 lines  |  [TEXT/MPS ]

  1. /* sysconf.c                        POSIX 4.8.1
  2.  *    long int sysconf(int name);
  3.  *
  4.  *    POSIX allows some of the values in <limits.h>
  5.  *  to be increased at run time.
  6.  *  The sysconf() function allows such values
  7.  *  to be checked at run time.
  8.  *  We do not use this facility.
  9.  */
  10.  
  11. #include "ThinkCPosix.h"
  12.  
  13. long int sysconf(name)
  14. int name;            /* property being inspected */
  15. {
  16.   switch(name) {
  17.     case _SC_CLOCKS_PER_SEC:
  18.         return (long) CLOCKS_PER_SEC;
  19.  
  20.     case _SC_OPEN_MAX:
  21.         return (long) OPEN_MAX;
  22.  
  23.     case _SC_JOB_CONTROL:
  24.         return -1L;            /* no job control */
  25.  
  26.     case _SC_SAVED_IDS:
  27.         return -1L;            /* no saved uid/gid */
  28.  
  29.     case _SC_VERSION:
  30.         return (long) _POSIX_VERSION;
  31.  
  32.     default:
  33.         errno = EINVAL;
  34.         return -1L;
  35.   }
  36. }
  37.